﻿@model SDCloudSolution.SDCloud.Web.Models.Model.ModelStatisticsViewModel
@if (Model != null)
{
    <div>
        <div id="widget-model-statistics-pie-chart" data-bind="ojComponent: {
            component: 'ojChart',
            type: 'pie',
            series: [
                { name: 'Sucess', color: 'rgb(104, 193, 130)', items: [@Model.TotalSuccessExecutionCount] },
                { name: 'Error', color: 'rgb(237, 102, 71)', items: [@Model.TotalFailedExecutionCount] }
            ],
            animationOnDisplay: 'no',
            animationOnDataChange: 'auto',
            hoverBehaviour: 'dim'
         }"
             style="width: 100%;"></div>
    </div>

    <div>
        <b>Model total run count:</b> @Model.TotalExecutionCount
    </div>
    <div>
        <b>Average execution time:</b> @Model.AverageExecutionTimeText
    </div>
    <div>
        <b>Average data usage:</b> @Model.AverageDataSizeUsageText
    </div>
}
else
{
    <div>
        No any model runs at now to displaying the statistics :)
    </div>
}